const modulesFn = require.context(
  "_my/views",
  true,
  /(?!.*components)(?!.*home)(?!.*login)(\/.*)\1\.vue$/
);
const publicRouter = [];
modulesFn.keys().forEach((item) => {
  const component = item.replace(/^(.)(.*)(\.vue)$/, "$2");
  const path = /\/([^\/]*)$/.exec(component)[1];
  publicRouter.push({
    path,
    name: path,
    component: () =>
      import(
        /* webpackChunkName: "[request]-[request]" */ `_my/views${component}`
      ),
  });
});
export default publicRouter;
